/*
 * PrefixedCacheKey.java
 * Copyright 2021 Qunhe Tech, all rights reserved.
 * Qunhe PROPRIETARY/CONFIDENTIAL, any form of usage is subject to approval.
 */

package top.bbman.boot.auth.key;

import java.io.Serializable;

public class PrefixedCacheKey<P, V> implements Serializable, CacheKey {

    private static final long serialVersionUID = -1L;

    private P prefix;
    private V value;

    public PrefixedCacheKey(P prefix, V value) {
        this.prefix = prefix;
        this.value = value;
    }

    public P getPrefix() {
        return prefix;
    }

    public V getValue() {
        return value;
    }

    @Override
    public String getStringKey() {
        return prefix + String.valueOf(value);
    }
}
